package com.zxy.supplier_system.server.xinyuan.repository

import com.zxy.supplier_system.server.xinyuan.entity.XinyuanGoodsCategory
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository

@Repository
interface XinyuanGoodsCategoryRepository : JpaRepository<XinyuanGoodsCategory, Int> {

    // 根据名称查找分类
    fun findByName(name: String): XinyuanGoodsCategory?

    // 根据家电/数码类型查找分类
    fun findByIsHomeAppliance(isHomeAppliance: Boolean): List<XinyuanGoodsCategory>

    // 根据名称模糊搜索
    fun findByNameContaining(name: String): List<XinyuanGoodsCategory>
}